#include <cstdint>
#include <utility>
#include <VideoRender.h>
#include "Demux.h"
//
// Created by baigui on 21-7-2.
//
class MediaPlayer;
class Looper;


Demux::Demux(weak_ptr<MediaPlayer> mediaPlayer): BaseModule(){
    mPlayer = weak_ptr<MediaPlayer>(mediaPlayer);
//    mMediaStream = make_shared<MediaStream>();
}

Demux::~Demux(){

}

//bool Demux::start(){
//
//    return true;
//}

void Demux::requestbuffer(){

}

shared_ptr<MediaStream> Demux::getStreamInfo() {
    return mMediaStream;
}

void Demux::addStreamInfo(shared_ptr<MediaStream> stream) {

//    LOGV("stream info %s   :%d",stream.get()->mime,stream->state);

    if(mMediaStream == nullptr){
        mMediaStream = stream;
    }

    shared_ptr<MediaStream> mediaStream = mMediaStream;

    while (mediaStream != nullptr){
            mediaStream = mediaStream->next;
    }
    mediaStream = shared_ptr<MediaStream>(stream);
    stream->next = nullptr;

}

